package com.lightsh.widget.testactivity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;

import com.lightsh.widget.R;

public class MainActivity extends Activity{
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        ListView list = (ListView)findViewById(R.id.mainList);
        
        
        list.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, android.R.id.text1, 
        		new String[]{getString(R.string.rotate3d), 
        			getString(R.string.hScrollView), 
        			getString(R.string.tabHost),
        			getString(R.string.testWidget)}));
        
        list.setOnItemClickListener(new OnItemClickListener() {

			public void onItemClick(AdapterView<?> parent, View view,
					int position, long id) {
				switch(position){
				case 0:{
					startActivity(new Intent(MainActivity.this, Rotate3dActivity.class));
				}
					break;
				case 1:{
					startActivity(new Intent(MainActivity.this, HScrollViewActivity.class));
				}
					break;
				case 2:{
					startActivity(new Intent(MainActivity.this, TabHostMainActivity.class));
				}
					break;
				case 3:{
					startActivity(new Intent(MainActivity.this, TestWidgetActivity.class));
				}
					break;
				}
				
			}
		});
        
    }
}